package Saas_Exercises;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

import javax.print.DocFlavor.CHAR_ARRAY;

/*
 10000.6660
 6660#.1 

 990.0080
 80###.99

 101.11111
 11111.101

 31644.0
 #####.31644

 */
public class Assignment03_WordFormat {

	void splitString(String original) {

		// split the string based on the delimiter
		String parts[] = original.split("\\.");
		String s1 = parts[0];
		String s2 = parts[1];

		// format the 1st String
		String mod_s1 = "";
		mod_s1 = s1.replaceAll("0+$", " ");

		// format the 2nd String
		int ist_string_length = 5;
		String mod_s2 = "";
		mod_s2 = s2.replaceAll("^0+", "");
		while (mod_s2.length() < ist_string_length) {

			mod_s2 = mod_s2 + "#";
		}

		// print the modified string
		System.out.println(mod_s2 + "." + mod_s1);

	}

	public static void main(String[] args) throws IOException {

		System.out.println("please enter your string");
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(isr);
		String str = br.readLine();
		Assignment03_WordFormat a3 = new Assignment03_WordFormat();
		a3.splitString(str);

	}

}
